package com.bs.qxglmanager.utils;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

/**
 * @author 小姚
 * @pakeageName:com.bs.qxglmanager.utils
 * @ClassName:Result
 * @Descirption:
 * @data 2023/2/22 13:33
 */
@Data
@NoArgsConstructor
public class Result<T> {
    private Integer code;
    private String msg;
    private T data;

    public Result(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static Result success(String msg){
       return new Result(200,msg,"");
    }

    public static Result success(Object data){
        return new Result(200,"成功",data);
    }
    public static Result success(){
        return new Result(200,"成功","");
    }

    public static Result error(String msg){
        return new Result(500,msg,"");
    }

    public static Result error(){
        return new Result(500,"失败","");
    }


}
